<%= content_tag :div, class: class_names(
  {
    "-mt-9": @field.stacked && !@field.hide_view_type_switcher
  }
) do %>
  <%= turbo_frame_tag @field.id do %>
    <% unless @field.hide_view_type_switcher %>
      <div class="justify-self-end flex justify-end items-center space-x-3">
        <%= render partial: 'avo/partials/view_toggle_button',
          locals: {
            available_view_types: @available_view_types,
            view_type: @view_type,
            turbo_frame: @field.id,
          }
        %>
      </div>
    <% end %>
    <%= content_tag :div, class: class_names(
      "py-4 rounded-2xl max-w-full",
      {
        "flex flex-col space-y-2": @view_type == :list,
        "relative grid xs:grid-cols-2 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 2xl:grid-cols-6 gap-6": @view_type == :grid
      }
    ) do %>
      <% @field.value.attachments.each do |file| %>
        <%= render view_type_component(file) %>
      <% end %>
    <% end %>
  <% end %>
<% end %>
